#ifndef SCENEMARK_H
#define SCENEMARK_H

#include <QGraphicsScene>
#include <QWidget>
#include <QString>
#include <QDataStream>
#include <QObject>

namespace Ui {
class SceneMark;
}

class SceneMark : public QWidget
{
    Q_OBJECT

public:
    enum    GWState    { ST_OK,ST_DISCONN,ST_LOW,ST_HIGH};
    explicit SceneMark(QWidget *parent = 0);
    explicit SceneMark(const SceneMark &other);
    int getChannelID() const;
    void setChannelID(int id);
    void setChannelPos(QString str);
    void setValue(float value);
    void setColor(int color);
    void setFontSize(int size);
    void setRelativeX(float x);
    void setRelativeY(float y);
    void getUI();
    float RelativeX() const;
    float RelativeY() const;
    void setConfig();
    bool getConfig();
    SceneMark& operator=(const SceneMark &other);
    friend QDataStream & operator >> (QDataStream &in,SceneMark& data);
    friend QDataStream & operator << (QDataStream &out,const  SceneMark& data);
    ~SceneMark();

private slots:
    void ValueChanged(float value);
    void StateChanged(int state);


private:
    Ui::SceneMark *ui;
    int ChannelID;
    QGraphicsScene statescene;
    float relativeX;
    float relativeY;
    bool isconfig;

    // QWidget interface

signals:
    void ChannelIDChanged(int newid);
    void newIDChanged(int newid);

protected:
    void mouseDoubleClickEvent(QMouseEvent *);
};

#endif // SCENEMARK_H
